1. Field of the Invention
The present invention relates to an apparatus for, and method of, encoding a signal. More particularly, but not exclusively, the signal is representative of data of the type used to produce an image or an audible tone.
2. Background
In broadcasting and telecommunications data can be in either digital or analog form. Increasingly data is transmitted in digital form. One reason for this is because larger amounts, of data can be transmitted in digital form than in analog form. Another is because digital signals are less prone to interference and can easily be recovered by using error correction techniques if they are distorted. However, as side effects of facile access to digital data, complaints of violation of copyright and tampering or modification of content are daily increasing.
It is known to insert special codes into data representing images, for example digital video signals for transmission or stills transmitted across a telecommunication link. One reason for doing this is to identify the owner of copyright in the images. A number of schemes exist for inserting identification codes into so-called xe2x80x9csync periodsxe2x80x9d. More recently it has been proposed to insert identification codes into the image itself, but in such a manner so that the code cannot be detected by a viewer. Similar schemes exist for inserting code into audio data.
U.S. Pat. No. 4,238,849 (ISE) describes a method of transmitting an additional data message, with a main data message via a single channel at a predetermined bandwidth. The additional data message is transmitted by modulating a sideband outside the baseband but within an inaudible tone spectrum masked by the main message.
Currently schemes suffer from the disadvantage that coded digital information cannot easily be transformed and maintain its integrity. Low pass filtering and other processes, such as data compression, may occur in compression algorithms or transmission of audio signals across a telecommunication links and such transforms may remove the code or degrade it to an extent where it cannot be recognised.
In the Applicant""s published International Patent Application WO-A1-9625005 (Todd), there is described a method of coding data into an image. The method of coding and decoding information into an image, comprises: dividing the image into Mxc3x97N blocks, selectively encoding information into selected blocks in such a way as not to be visible to the eye, wherein in a decoding stage, the decoding is synchronised to the occurrence of the blocks for analysis of image information. In a preferred embodiment the size of insertions and their positions are fixed by processing the image in a block-by-block manner, typically with a block size of 8 by 8 pixels.
Devices for inserting an inaudible, unique identification code into a piece of audio data, also exist. In the Applicant""s published, pending International Patent Application, WO-A1-9621290 (Best et al), there is described an apparatus and method for labelling a stereophonic audio signal with a code.
One technique embeds codes into two notches (around 3 kHz) when there is enough audio energy to mask the codes. A masking filter, which covers the notches and a region below the notches, in the frequency domain, is used to analyse audio energy around the frequency of the notches. A code may be placed into the notches if the ratio of the energy in the notches (and that of the masking filter) exceeds a predetermined threshold. However, even though that condition is satisfied, the codes may not always be properly masked and therefore can become audible for some types of audio data, especially when the code energy level is high.
Although the aforementioned devices and methods proved successful in many types of embedded code in music, the embedded code signal was still audible in certain circumstances. This is because either there was sufficient audio energy around the notches to hide the code, or the amplitude of code signal is too high. Because a large percentage of energy of many types of sound is in the area below 3 kHz (for example energy in the speaking human voice) and the energy in the masking filter is not sufficently large, code is sometimes audible. This may occur even if there appears to be sufficient energy around the notches to hide the codes. For example, if an audible signal (EN) is removed from notch frequency and a code is inserted, a listener cannot usually distinguish between the code and say, music. However, in an event when no musical note is present then a listener can hear the audible code.
The present invention arose in order to solve the foregoing problems, particularly with regard to the audibility of embedded codes.
According to a first aspect of the present invention there is provided apparatus for encoding a code signal into a signal, for example for identifying said audio signal, the apparatus comprising means for determining an amount of energy within a first frequency band of audio signal; means for determining an amount of energy within a second frequency band of audio signal; means for determining an amount of energy within at least two notch frequency bands; means for generating a code signal to be embedded with a particular energy content; means for comparing the energy from said first and second bands with the energy from said notch frequency bands in order to determine whether to insert the code signal into the chosen notch frequency bands; and means for removing a portion of the signal and replacing it with said code signal if so determined.
Preferably means for automatically controlling an amplitude of the code signal in an encoder, by the amount of energy in the first frequency band or/and that in the second frequency band, are also provided. Means is advantageously provided for automatic gain control in the decoder. Automatic gain control by the amount of energy in the first frequency band and/or that in the second frequency band may also be provided.
The first and second means for determining energy may be combined with different frequency bands (and therefore different energies). This choice may be determined by way of a switching function and/or buffer which stores information about the energy of each sampled band. The switching function can be arranged to shift a sampling band. This may be achieved digitally, for example under control of a micro-processor.
Means may be provided for determining frequency bands of notches at which a code signal is to be inserted. Accordingly, some form of variable frequency encoding means may be required to shift a coding frequency band from a first frequency (f1) to a second frequency (f2) or to other frequencies
A particularly elegant switching function involves shifting two sampling filters. These are hereinafter referred to as a High Frequency Mask Filter (HFMF) and a Low Frequency Mask Filter (LFMF) respectively. The filters are preferably capable of operating over substantially identical frequency ranges one to another.
A High Frequency Masking Filter (HFMF) is intended to analyse audio energy in that frequency range or band in order to check whether or not codes can be masked properly. The HFMF preferably extents to notch (and frequency ranges) higher than in the frequency domain. The function governing the LFMF characteristics may be similar to that of a HFMF. This may be achieved practically by xe2x80x9cflippingxe2x80x9d HFMF characteristics horizontally and shifting the curve, so that the HFMF effectively extends across the same, or substantially same, frequency band, including the notch frequencies but extending to a lower frequency region.
There are two possible methods envisaged for using the HFMF for making a decision where to insert a code signal into an audio signal:
1) The first involves using the HFMF alone. A code signal is embedded into the notches when the ratio of energy in the notch bands and that of HFMF reaches a threshold. In general, audio energy is mainly present at or around a low frequency band. Thus the codes are properly hidden if there is enough energy in the HFMF.
If this is not possible then a second method uses a HFMF in combination with a LFMF. A code signal can be embedded into the notch when both ratios (the ratio of energy in the notch band and that of the HFMF and the ratio of energy in the notch band and that of the LFMF) reach their corresponding thresholds.
An indication of energy content of the signal may be provided by integrators across each frequency band and automatic comparators may provide a digital value. These comparisons are preferably achieved under control of a micro-processor.
To control automatically the amplitude of a code signal, the energy from the HFMF or/and that from the LFMF can be used to control a code signal amplifier, in the encoder, so that the level of the code signal varies depending on the energy around the region where the code signal is inserted. Thus the code signal may be masked properly and is never audible.
In the decoder where the same HFMF or/and LFMF can be used, the energy from the HFMF or/and the LFMF is/are used to automatically the gain of an amplifier for the encoded audio signal, so that the embedded codes can be correctly detected.